/*******************************************************************************
GImage.cpp

	Author:		LiuDingXi
	e-mail:		liudx@gmail.com
	Date time:	2009-08-26

	Copyright (C) 2009
	All rights reserved.
	
*******************************************************************************/
#include "StdAfx.h"
#include "GImage.h"
#include "GameDC.h"
#include "Texture2D.h"

#if (_OS_ == _OS_WINNT_)
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif
#endif//(_OS_ == _OS_WINNT_)

////////////////////////////////////////////////////////////////////////////////

GImage::GImage()
{
	m_lpData = NULL;
}

GImage::~GImage()
{
	if(m_lpData)
	{
		CTexture2D* pTextrue = (CTexture2D*)m_lpData;
		delete pTextrue;
		m_lpData = NULL;
	}
}

BOOL GImage::Load(LPCTSTR szFileName, int)
{
	CTexture2D* pTexture = new CTexture2D;
	if(pTexture)
	{
		if(pTexture->Load(szFileName))
		{
			m_lpData = pTexture;
			return TRUE;
		}
		delete pTexture;
	}
	return FALSE;
}
